home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / rcs56.zoo / rcs / src / conf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-02-07  |  15.4 KB  |  508 lines

  1. /* example RCS compile-time configuration */
  2.  
  3.     /* $Id: conf.heg,v 1.8 1991/11/20 18:21:09 eggert Exp $ */
  4.  
  5. /*
  6.  * This example RCS compile-time configuration describes a host that conforms
  7.  * to Standard C (1990) and Posix 1003.1-1990 and has GNU diff.
  8.  * If you can't get conf.sh to work as described in the Makefile,
  9.  * copy this file to conf.h and edit conf.h by hand; see README.
  10.  */
  11.  
  12. #define exitmain(n) return n /* how to exit from main() */
  13. /* #define _POSIX_SOURCE */ /* Define this if Posix + strict Standard C.  */
  14.  
  15. #include <errno.h>
  16. #include <stdio.h>
  17. #include <time.h>
  18.  
  19. /* Comment out #include lines below that do not work.  */
  20. #include <sys/types.h>
  21. #include <sys/stat.h>
  22. #include <dirent.h>
  23. #include <fcntl.h>
  24. #include <limits.h>
  25. #include <pwd.h>
  26. #include <signal.h>
  27. #include <stdlib.h>
  28. #include <string.h>
  29. /* #include <sys/mman.h> */
  30. #include <sys/wait.h>
  31. #include <unistd.h>
  32. /* #include <utime.h> */
  33. /* #include <vfork.h> */
  34.  
  35. /* Define the following symbols to be 1 or 0.  */
  36. #define has_sys_dir_h 0 /* Does #include <sys/dir.h> work?  */
  37. #define has_sys_param_h 0 /* Does #include <sys/param.h> work?  */
  38. #define has_readlink 0 /* Does readlink() work?  */
  39.  
  40. /* #undef NAME_MAX */ /* Uncomment this if NAME_MAX is broken.  */
  41.  
  42. #if !defined(NAME_MAX) && !defined(_POSIX_NAME_MAX)
  43. #    if has_sys_dir_h
  44. #        include <sys/dir.h>
  45. #    endif
  46. #    ifndef NAME_MAX
  47. #        ifndef MAXNAMLEN
  48. #            define MAXNAMLEN 14
  49. #        endif
  50. #        define NAME_MAX MAXNAMLEN
  51. #    endif
  52. #endif
  53. #if !defined(PATH_MAX) && !defined(_POSIX_PATH_MAX)
  54. #    if has_sys_param_h
  55. #        include <sys/param.h>
  56. #        define included_sys_param_h 1
  57. #    endif
  58. #    ifndef PATH_MAX
  59. #        ifndef MAXPATHLEN
  60. #            define MAXPATHLEN 1024
  61. #        endif
  62. #        define PATH_MAX (MAXPATHLEN-1)
  63. #    endif
  64. #endif
  65. #if has_readlink && !defined(MAXSYMLINKS)
  66. #    if has_sys_param_h && !included_sys_param_h
  67. #        include <sys/param.h>
  68. #    endif
  69. #    ifndef MAXSYMLINKS
  70. #        define MAXSYMLINKS 20 /* BSD; not standard yet */
  71. #    endif
  72. #endif
  73.  
  74. /* Comment out the keyword definitions below if the keywords work.  */
  75. /* #define const */
  76. /* #define volatile */
  77.  
  78. /* Comment out the typedefs below if the types are already declared.  */
  79. /* Fix any uncommented typedefs that are wrong.  */
  80. typedef int mode_t;
  81. /* typedef int pid_t; */
  82. /* typedef int sig_atomic_t; */
  83. /* typedef unsigned size_t; */
  84. typedef int ssize_t;
  85. /* typedef long time_t; */
  86. /* typedef int uid_t; */
  87.  
  88. /* Define the following symbols to be 1 or 0.  */
  89. #define has_prototypes 1 /* Do function prototypes work?  */
  90. #define has_stdarg 1 /* Does <stdarg.h> work?  */
  91. #define has_varargs 0 /* Does <varargs.h> work?  */
  92. #define va_start_args 2 /* How many args does va_start() take?  */
  93. #if has_prototypes
  94. #    define P(params) params
  95. #else
  96. #    define P(params) ()
  97. #endif
  98. #if has_stdarg
  99. #    include <stdarg.h>
  100. #else
  101. #    if has_varargs
  102. #        include <varargs.h>
  103. #    else
  104.         typedef char *va_list;
  105. #        define va_dcl int va_alist;
  106. #        define va_start(ap) ((ap) = (va_list)&va_alist)
  107. #        define va_arg(ap,t) (((t*) ((ap)+=sizeof(t)))  [-1])
  108. #        define va_end(ap)
  109. #    endif
  110. #endif
  111. #if va_start_args == 2
  112. #    define vararg_start va_start
  113. #else
  114. #    define vararg_start(ap,p) va_start(ap)
  115. #endif
  116.  
  117. #define text_equals_binary_stdio 0 /* Does stdio treat text like binary?  */
  118. #define text_work_stdio 1 /* Text i/o for working file, binary for RCS file?  */
  119. #if text_equals_binary_stdio
  120.     /* Text and binary i/o behave the same, or binary i/o does not work.  */
  121. #    define FOPEN_R "r"
  122. #    define FOPEN_W "w"
  123. #    define FOPEN_WPLUS "w+"
  124. #else
  125.     /* Text and binary i/o behave differently.  */
  126.     /* This is incompatible with Posix and Unix.  */
  127. #    define FOPEN_R "rb"
  128. #    define FOPEN_W "wb"
  129. #    define FOPEN_WPLUS "w+b"
  130. #endif
  131. #if text_work_stdio
  132. #    define FOPEN_R_WORK "r"
  133. #    define FOPEN_W_WORK "w"
  134. #    define FOPEN_WPLUS_WORK "w+"
  135. #else
  136. #    define FOPEN_R_WORK FOPEN_R
  137. #    define FOPEN_W_WORK FOPEN_W
  138. #    define FOPEN_WPLUS_WORK FOPEN_WPLUS
  139. #endif
  140.  
  141. /* Define or comment out the following symbols as needed.  */
  142. #define bad_fopen_wplus 0 /* Does fopen(f,FOPEN_WPLUS) fail to truncate f?  */
  143. #define getlogin_is_secure 0 /* Is getlogin() secure?  Usually it's not.  */
  144. #define has_dirent 1 /* Do opendir(), readdir(), closedir() work?  */
  145. #define has_fchmod 0 /* Does fchmod() work?  */
  146. #define has_fputs 1 /* Does fputs() work?  */
  147. #define has_ftruncate 0 /* Does ftruncate() work?  */
  148. #define has_getuid 1 /* Does getuid() work?  */
  149. #define has_getpwuid 1 /* Does getpwuid() work?  */
  150. #define has_link 0 /* Does link() work?  */
  151. #define has_memcmp 1 /* Does memcmp() work?  */
  152. #define has_memcpy 1 /* Does memcpy() work?  */
  153. #define has_memmove 1 /* Does memmove() work?  */
  154. #define has_madvise 0 /* Does madvise() work?  */
  155. #define has_mmap 0 /* Does mmap() work on regular files?  */
  156. #define has_rename 1 /* Does rename() work?  */
  157. #define bad_a_rename 1 /* Does rename(A,B) fail if A is unwritable?  */
  158. #define bad_b_rename 1 /* Does rename(A,B) fail if B is unwritable?  */
  159. #define VOID (void) /* 'VOID e;' discards the value of an expression 'e'.  */
  160. #define has_seteuid 0 /* Does seteuid() work?  See README.  */
  161. #define has_setuid 0 /* Does setuid() exist?  */
  162. #define has_signal 1 /* Does signal() work?  */
  163. #define signal_args P((int)) /* arguments of signal handlers */
  164. #define signal_type void /* type returned by signal handlers */
  165. #define sig_zaps_handler 0 /* Must a signal handler reinvoke signal()?  */
  166. #define has_sigaction 0 /* Does struct sigaction work?  */
  167. #define has_sigblock 0 /* Does sigblock() work?  */
  168. /* #define sigmask(s) (1 << ((s)-1)) */ /* Yield mask for signal number.  */
  169. #define has_sys_siglist 0 /* Does sys_siglist[] work?  */
  170. typedef size_t fread_type; /* type returned by fread() and fwrite() */
  171. typedef size_t freadarg_type; /* type of their size arguments */
  172. typedef void *malloc_type; /* type returned by malloc() */
  173. #define has_getcwd 0 /* Does getcwd() work?  */
  174. #define has_getwd 1 /* Does getwd() work?  */
  175. #define has_mktemp 0 /* Does mktemp() work?  */
  176. #define has_NFS 0 /* Might NFS be used?  */
  177. /* #define strchr index */ /* Use old-fashioned name for strchr()?  */
  178. /* #define strrchr rindex */ /* Use old-fashioned name for strrchr()?  */
  179. #define bad_unlink 1 /* Does unlink() fail on unwritable files?  */
  180. #define has_vfork 0 /* Does vfork() work?  */
  181. #define has_fork 0 /* Does fork() work?  */
  182. #define has_spawn 0 /* Does spawn*() work?  */
  183. #define has_wait 0 /* Does wait() work?  */
  184. #define has_waitpid 0 /* Does waitpid() work?  */
  185. #define RCS_SHELL "/bin/sh" /* shell to run RCS subprograms */
  186. #define has_vfprintf 1 /* Does vfprintf() work?  */
  187. #define has__doprintf 0 /* Does _doprintf() work?  */
  188. #define has__doprnt 0 /* Does _doprnt() work?  */
  189. /* #undef EXIT_FAILURE */ /* Uncomment this if EXIT_FAILURE is broken.  */
  190. #define large_memory 0 /* Can main memory hold entire RCS files?  */
  191. /* #undef ULONG_MAX */ /* Uncomment this if ULONG_MAX is broken (e.g. < 0).  */
  192. /* struct utimbuf { time_t actime, modtime; }; */ /* Uncomment this if needed.  */
  193. #define CO "co.ttp" /* name of 'co' program */
  194. #define COMPAT2 0 /* Are version 2 files supported?  */
  195. #define DATEFORM "%.2d.%.2d.%.2d.%.2d.%.2d.%.2d" /* e.g. 01.01.01.01.01.01 */
  196. #define DIFF "diff.ttp" /* name of 'diff' program */
  197. #define DIFF3 "diff3.ttp" /* name of 'diff3' program */
  198. #define DIFF3_BIN 1 /* Is diff3 user-visible (not the /usr/lib auxiliary)?  */
  199. #define DIFF_FLAGS , "-an" /* Make diff output suitable for RCS.  */
  200. #define DIFF_L 1 /* Does diff -L work? */
  201. #define DIFF_SUCCESS 0 /* DIFF status if no differences are found */
  202. #define DIFF_FAILURE 1 /* DIFF status if differences are found */
  203. #define DIFF_TROUBLE 2 /* DIFF status if trouble */
  204. #define ED "/bin/ed" /* name of 'ed' program (used only if !DIFF3_BIN) */
  205. #define MERGE "merge.ttp" /* name of 'merge' program */
  206. #define TMPDIR "/tmp" /* default directory for temporary files */
  207. #define SLASH '/' /* principal pathname separator */
  208. /* #define SLASHes '/' /* `case SLASHes:' labels all pathname separators */
  209. /* `case SLASHes:' labels all pathname separators */
  210. #define SLASHes '/': case '\\'
  211. /* #define isSLASH(c) ((c) == SLASH) /* Is arg a pathname separator?  */
  212. #include <ctype.h>
  213. #define ROOTPATH(p) (isSLASH((p)[0]) || (isalpha((p)[0]) && (p)[1] == ':')) /* Is p an absolute pathname?  */
  214. /* #define ROOTPATH(p) isSLASH((p)[0]) /* Is p an absolute pathname?  */
  215. #define X_DEFAULT "/" /* default value for -x option */
  216. #define DIFF_ABSOLUTE 0 /* Is ROOTPATH(DIFF) true?  */
  217. #define ALL_ABSOLUTE 0 /* Are all subprograms absolute pathnames?  */
  218. #define SENDMAIL "/bin/mail" /* how to send mail */
  219. #define TZ_must_be_set 0 /* Must TZ be set for gmtime() to work?  */
  220.  
  221. #ifdef WIFEXITED
  222. #  undef WIFEXITED
  223. #endif
  224. #ifdef WEXITSTATUS
  225. #  undef WEXITSTATUS
  226. #endif
  227.  
  228. #define WIFEXITED(stat_val) ((stat_val) >= 0)
  229. #define WEXITSTATUS(stat_val) (stat_val)
  230.  
  231. /* Adjust the following declarations as needed.  */
  232.  
  233.  
  234. #if __GNUC__ && !__STRICT_ANSI__
  235. #    define exiting volatile /* GCC extension: function cannot return */
  236. #else
  237. #    define exiting
  238. #endif
  239.  
  240. #if has_ftruncate
  241.     int ftruncate P((int,off_t));
  242. #endif
  243.  
  244. /* <sys/mman.h> */
  245. #if has_madvise
  246.     int madvise P((caddr_t,size_t,int));
  247. #endif
  248. #if has_mmap
  249.     caddr_t mmap P((caddr_t,size_t,int,int,int,off_t));
  250.     int munmap P((caddr_t,size_t));
  251. #endif
  252.  
  253.  
  254. /* Posix (ISO/IEC 9945-1: 1990 / IEEE Std 1003.1-1990) */
  255. /* These definitions are for the benefit of non-Posix hosts, and */
  256. /* Posix hosts that have Standard C compilers but traditional include files.  */
  257. /* Unfortunately, mixed-up hosts are all too common.  */
  258.  
  259. /* <fcntl.h> */
  260. #ifdef F_DUPFD
  261.     int fcntl P((int,int,...));
  262. #else
  263.     int dup2 P((int,int));
  264. #endif
  265. #ifndef O_BINARY /* some non-Posix hosts need O_BINARY */
  266. #    define O_BINARY 0 /* no effect on Posix */
  267. #endif
  268. #ifdef O_CREAT
  269. #    define open_can_creat 1
  270. #else
  271. #    define open_can_creat 0
  272. #    define O_RDONLY 0
  273. #    define O_WRONLY 1
  274. #    define O_RDWR 2
  275. #    define O_CREAT 01000
  276. #    define O_TRUNC 02000
  277.     int creat P((char const*,mode_t));
  278. #endif
  279. #ifndef O_EXCL
  280. #    define O_EXCL 0
  281. #endif
  282.  
  283. /* <pwd.h> */
  284. #if has_getpwuid
  285.     struct passwd *getpwuid P((int));
  286. #endif
  287.  
  288. /* <signal.h> */
  289. #if has_sigaction
  290.     int sigaction P((int,struct sigaction const*,struct sigaction*));
  291.     int sigaddset P((sigset_t*,int));
  292.     int sigemptyset P((sigset_t*));
  293. #else
  294. #if has_sigblock
  295.     /* BSD */
  296.     int sigblock P((int));
  297.     int sigmask P((int));
  298.     int sigsetmask P((int));
  299. #endif
  300. #endif
  301.  
  302. /* <stdio.h> */
  303. FILE *fdopen P((int,char const*));
  304. int fileno P((FILE*));
  305.  
  306. /* <sys/stat.h> */
  307. int chmod P((char const*,mode_t));
  308. int fstat P((int,struct stat*));
  309. int stat P((char const*,struct stat*));
  310. mode_t umask P((mode_t));
  311. #if has_fchmod
  312.     int fchmod P((int,mode_t));
  313. #endif
  314. #ifndef S_IRUSR
  315. #    ifdef S_IREAD
  316. #        define S_IRUSR S_IREAD
  317. #    else
  318. #        define S_IRUSR 0400
  319. #    endif
  320. #    ifdef S_IWRITE
  321. #        define S_IWUSR S_IWRITE
  322. #    else
  323. #        define S_IWUSR (S_IRUSR/2)
  324. #    endif
  325. #endif
  326. #ifndef S_IRGRP
  327. #    if has_getuid
  328. #        define S_IRGRP (S_IRUSR / 0010)
  329. #        define S_IWGRP (S_IWUSR / 0010)
  330. #        define S_IROTH (S_IRUSR / 0100)
  331. #        define S_IWOTH (S_IWUSR / 0100)
  332. #    else
  333.         /* single user OS -- not Posix or Unix */
  334. #        define S_IRGRP 0
  335. #        define S_IWGRP 0
  336. #        define S_IROTH 0
  337. #        define S_IWOTH 0
  338. #    endif
  339. #endif
  340. #ifndef S_ISREG
  341. #    define S_ISREG(n) (((n) & S_IFMT) == S_IFREG)
  342. #endif
  343.  
  344. /* <sys/wait.h> */
  345. #if has_wait
  346.     pid_t wait P((int*));
  347. #endif
  348. #ifndef WEXITSTATUS
  349. #    define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
  350. #    undef WIFEXITED /* Avoid 4.3BSD incompatibility with Posix.  */
  351. #endif
  352. #ifndef WIFEXITED
  353. #    define WIFEXITED(stat_val) (!((stat_val) & 255))
  354. #endif
  355.  
  356. /* <unistd.h> */
  357. char *getlogin P((void));
  358. int close P((int));
  359. int isatty P((int));
  360. int link P((char const*,char const*));
  361. int open P((char const*,int,...));
  362. int unlink P((char const*));
  363. /* int _filbuf P((FILE*)); *//* keeps lint quiet in traditional C */
  364. /* int _flsbuf P((int,FILE*)); *//* keeps lint quiet in traditional C */
  365. long pathconf P((char const*,int));
  366. ssize_t write P((int,const void*,unsigned int));
  367. #ifndef STDIN_FILENO
  368. #    define STDIN_FILENO 0
  369. #    define STDOUT_FILENO 1
  370. #    define STDERR_FILENO 2
  371. #endif
  372. #if has_fork
  373. #    if !has_vfork
  374. #        undef vfork
  375. #        define vfork fork
  376. #    endif
  377.     pid_t vfork P((void)); /* vfork is nonstandard but faster */
  378. #endif
  379. #if has_getcwd || !has_getwd
  380.     char *getcwd P((char*,size_t));
  381. #else
  382.     char *getwd P((char*));
  383. #endif
  384. #if has_getuid
  385.     uid_t getuid P((void));
  386. #endif
  387. #if has_readlink
  388.     ssize_t readlink P((char const*,char*,size_t)); /* BSD; not standard yet */
  389. #endif
  390. #if has_setuid
  391. #    if !has_seteuid
  392. #        undef seteuid
  393. #        define seteuid setuid
  394. #    endif
  395.     int seteuid P((uid_t));
  396.     uid_t geteuid P((void));
  397. #endif
  398. #if has_spawn
  399.     int spawnv P((int,char const*,char*const*));
  400. #    if ALL_ABSOLUTE
  401. #        define spawn_RCS spawnv
  402. #    else
  403. #        define spawn_RCS spawnvp
  404.         int spawnvp P((int,char const*,char*const*));
  405. #    endif
  406. #else
  407.     int execv P((char *,char**));
  408. #    if ALL_ABSOLUTE
  409. #        define exec_RCS execv
  410. #    else
  411. #        define exec_RCS execvp
  412.         int execvp P((char *,char**));
  413. #    endif
  414. #endif
  415.  
  416. /* utime.h */
  417. int utime P((char const*,struct utimbuf const*));
  418.  
  419.  
  420. /* Standard C library */
  421. /* These definitions are for the benefit of hosts that have */
  422. /* traditional C include files, possibly with Standard C compilers.  */
  423. /* Unfortunately, mixed-up hosts are all too common.  */
  424.  
  425. /* <errno.h> */
  426. extern int errno;
  427.  
  428. /* <limits.h> */
  429. #ifndef ULONG_MAX
  430.     /* This does not work in #ifs, but it's good enough for us.  */
  431. #    define ULONG_MAX ((unsigned long)-1)
  432. #endif
  433.  
  434. /* <signal.h> */
  435. #if has_signal
  436.     signal_type (*signal P((int,signal_type(*)signal_args)))signal_args;
  437. #endif
  438.  
  439. /* <stdio.h> */
  440. FILE *fopen P((char const*,char const*));
  441. fread_type fread P((void*,freadarg_type,freadarg_type,FILE*));
  442. fread_type fwrite P((void const*,freadarg_type,freadarg_type,FILE*));
  443. int fclose P((FILE*));
  444. int feof P((FILE*));
  445. int ferror P((FILE*));
  446. int fflush P((FILE*));
  447. int fprintf P((FILE*,char const*,...));
  448. int fputs P((char const*,FILE*));
  449. int fseek P((FILE*,long,int));
  450. int printf P((char const*,...));
  451. int rename P((char const*,char const*));
  452. int sprintf P((char*,char const*,...));
  453. long ftell P((FILE*));
  454. void clearerr P((FILE*));
  455. void perror P((char const*));
  456. #ifndef L_tmpnam
  457. #    define L_tmpnam 32 /* power of 2 > sizeof("/usr/tmp/xxxxxxxxxxxxxxx") */
  458. #endif
  459. #ifndef SEEK_SET
  460. #    define SEEK_SET 0
  461. #endif
  462. #if has_mktemp
  463.     char *mktemp P((char*)); /* traditional */
  464. #else
  465.     char *tmpnam P((char*));
  466. #endif
  467. #if has_vfprintf
  468.     int vfprintf P((FILE*,char const*,va_list));
  469. #else
  470. #if has__doprintf
  471.     void _doprintf P((FILE*,char const*,va_list)); /* Minix */
  472. #else
  473.     void _doprnt P((char const*,va_list,FILE*)); /* BSD */
  474. #endif
  475. #endif
  476.  
  477. /* <stdlib.h> */
  478. char *getenv P((char const*));
  479. exiting void _exit P((int));
  480. exiting void exit P((int));
  481. malloc_type malloc P((size_t));
  482. malloc_type realloc P((malloc_type,size_t));
  483. void free P((malloc_type));
  484. #ifndef EXIT_FAILURE
  485. #    define EXIT_FAILURE 1
  486. #endif
  487. #ifndef EXIT_SUCCESS
  488. #    define EXIT_SUCCESS 0
  489. #endif
  490. #if !has_fork && !has_spawn
  491.     int system P((char const*));
  492. #endif
  493.  
  494. /* <string.h> */
  495. char *strcpy P((char*,char const*));
  496. char *strchr P((char const*,int));
  497. char *strrchr P((char const*,int));
  498. int memcmp P((void const*,void const*,size_t));
  499. int strcmp P((char const*,char const*));
  500. size_t strlen P((char const*));
  501. void *memcpy P((void*,void const*,size_t));
  502. #if has_memmove
  503.     void *memmove P((void*,void const*,size_t));
  504. #endif
  505.  
  506. /* <time.h> */
  507. time_t time P((time_t*));
  508.